import request from '@/utils/request'

// 生成语音（完整参数）
export function generateSpeech(data) {
  return request({
    url: '/bus/tts/generate',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 生成语音（默认参数）
export function generateSpeechDefault(text) {
  return request({
    url: '/bus/tts/generate/default',
    method: 'post',
    data: {
      text: text
    }
  })
}

// 获取语音配置
export function getVoiceConfig() {
  return request({
    url: '/bus/tts/config',
    method: 'get'
  })
}

// 删除语音文件
export function deleteVoiceFile(filePath) {
  return request({
    url: '/bus/tts/file',
    method: 'delete',
    params: {
      filePath: filePath
    }
  })
}

// 清理过期语音文件
export function cleanExpiredFiles(days = 7) {
  return request({
    url: '/bus/tts/clean',
    method: 'post',
    params: {
      days: days
    }
  })
}

// 生成站点播报语音
export function generateStationAnnouncement(stationName, announcementType) {
  return request({
    url: '/bus/tts/station',
    method: 'post',
    data: {
      stationName: stationName,
      announcementType: announcementType
    }
  })
}